ds_map_find_value


描述

With this function you can get the value from a specified key. The input values of the function are the (previously created) ds_map to use and the key to check for.

NOTE: If no such key exists then the function will return <undefined>. You should always check this using the is_undefined() function


语法:

ds_map_find_value(id, key)

参数 描述
id The id of the map to use.
key The key to find.


返回:

Real, string or undefined


例如:

amount = ds_map_find_value(inventory, "food");

Or, using the map accessor "?":

amount = inventory[? "food"];

The above code will get the value of the key "food" and store it in the variable "amount".